package com.example.myapplication.fragment;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class FragmentAdapter extends FragmentPagerAdapter {

    private  List<Fragment> mList = new ArrayList<>();

    public FragmentAdapter(@NonNull FragmentManager fm, List<Fragment> l) {
        super(fm);
        mList = l;
    }


    @Override
    public Fragment getItem(int position){
        return mList.get(position);
    }

    @Override
    public int getCount(){
        return mList == null ? 0 : mList.size();
    }

}
